Field
The embodiments relate generally to databases and more specifically to query optimization using cardinality estimation.
Background
Computer databases have become a prevalent means for data storage and retrieval. A database user will commonly access the underlying data in a database using a Database Management System (“DBMS”). A user issues a query to the DBMS that conforms to a defined query language. When a DBMS receives a query, it determines a query plan for the query. Once determined, the DBMS then uses the query plan to execute the query. As part of determining an efficient query plan, a DBMS relies on cardinality estimates that estimate the sizes (i.e., how many rows) of queries and sub-queries. Cardinality estimates are used to assess the efficiency (e.g., cost) of the query plan before the query plan is executed.